#ifndef NMC_TILELAYER_HPP
#define NMC_TILELAYER_HPP

#include <allegro.h>

namespace nmc
{
	class TileSet;

	class TileLayer
	{
	public:
		static const int TILE_SIZE = 16;

		static const int SOLID = 1;
        static const int PLATFORM = 2;
        static const int ICE = 4;
        static const int BACKGROUND = 8;

		TileLayer(int width, int height, int fillTile = 0);
		
		TileLayer(const TileLayer& other); 

		~TileLayer();

		int getTile(int x, int y);

		void setTile(int x, int y, int tile);

		void clear(int tile = 0);

		int getWidth();

		int getHeight();
		
		TileLayer* clonePart(int x, int y, int width, int height);

		void pastePart(TileLayer* tileLayer, int x, int y, bool transparency);

		void draw(BITMAP* dest, int scrollx, int scrolly, TileSet *tileSet);

	protected:
		unsigned short *mTiles;
		int mWidth, mHeight;
	};
}

#endif